import { createSlice } from '@reduxjs/toolkit';
const tabSlice = createSlice({
    name: 'tab',
    initialState: {
        current: 1,
        tabs: [{ id: 1, text: '首页' }, { id: 2, text: '关于' }, { id: 3, text: '联系' }],
    },
    reducers: {
        setActive (state, action) {
            state.current = action.payload.id;
        }
    }
});
export const { setActive } = tabSlice.actions;
export default tabSlice.reducer;
